package com.example.abc.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by Peter on 2018/4/26.
 */
@Component
public class Constants {

    private static Logger logger = LoggerFactory.getLogger(Constants.class);

    //log 记录方法入参的前缀
    public static final String prefix_in = "\nparameters in -->> ";
    //log 记录方法出参的前缀
    public static final String prefix_out = "\nparameters out -->>";




    // 阿里云OSS
    public static String ossEndpoint = "http://oss-cn-hangzhou.aliyuncs.com";
    @Value("${aliyun.oss.endpoint}")
    public void setOssEndpoint(String value){
        logger.info("aliyun.oss.endpoint="+value);
        ossEndpoint = value;
    }

    public static String ossAccessKeyId = "dzhm6kIZDL8VpgPP";
    @Value("${aliyun.oss.accessKeyId}")
    public void setOssAccessKeyId(String value){
        logger.info("aliyun.oss.accessKeyId="+value);
        ossAccessKeyId = value;
    }

    public static String ossAccessKeySecret = "4qSofG2TiEABy1Gcs0IhgHXpdLKust";
    @Value("${aliyun.oss.accessKeySecret}")
    public void setOssAccessKeySecret(String value){
        logger.info("aliyun.oss.accessKeySecret="+value);
        ossAccessKeySecret = value;
    }

    public static String ossBucketName = "waijiaojun";
    @Value("${aliyun.oss.bucketName}")
    public void setOssBucketName(String value){
        logger.info("aliyun.oss.bucketName="+value);
        ossBucketName = value;
    }

    public static String ossRootDir;
    @Value("${aliyun.oss.rootDir}")
    public void setOssRootDir(String value){
        logger.info("aliyun.oss.rootDir="+value);
        ossRootDir = value;
    }

    public static String ossDomain;
    @Value("${aliyun.oss.domain}")
    public void setOssDomain(String value){
        logger.info("aliyun.oss.domain="+value);
        ossDomain = value;
    }

    public static String websocketUrl;
    @Value("${websocket.url}")
    public void setWebsocketUrl(String value){
        logger.info("websocket.url="+value);
        websocketUrl = value;
    }
}
